package org.hb0712.sya.tools.database.demo;
/*
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
*/

public class OracleJdbcDemo {
    /*
    public static void main(String[] args) {
        // 数据库连接信息
        String jdbcUrl = "jdbc:oracle:thin:@//localhost:1521/ServiceName";
        String username = "igame";
        String password = "mima";

        try {
            // 1. 建立连接
            Connection connection = DriverManager.getConnection(jdbcUrl, username, password);
            // 2. 创建Statement对象
            Statement statement = connection.createStatement();
            // 3. 执行SQL查询
            ResultSet resultSet = statement.executeQuery("SELECT 'Hello Oracle' AS message FROM DUAL");
            // 4. 处理结果集
            while (resultSet.next()) {
                String message = resultSet.getString("message");
                System.out.println("Result: " + message);
            }
        } catch (SQLException e) {
            System.err.println("数据库连接失败，错误信息:");
            e.printStackTrace();
        }
    }*/
}
